/*This file is part of AENIMA. AENIMA is a module of BCI++ framework for the implementation of brain computerinterface systems. 
AEnima is intended for use with BCI++ only.

BCI++ is a project of the Sensibilab of the Politecnico di Milano. 

AENIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation, either version 3 of 
the License, or (at your option) any later version.

AENIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
and the GNU Lesser General Public License along with AENIMA.  
If not, see <http://www.gnu.org/licenses/>.*/

/*!
	\file	EventReceiver.h
	 This file contains the events manager.\n
	 
	\author	Luca Maggi		E-Mail: luca.maggi@polimi.it\n
			Sergio Parini	E-Mail: sergio.parini@polimi.it

	\date	2007-09-06 creation \n
		2008-01-27 last modification

	\b COPYRIGHT: 
		This program is property of Sensibilab - Campus Ponit - Lecco
*/

#pragma once

#include "SocketComm.h"
#include "GraphicEngine.h"
#include "ProtocolMngr.h"
#include "SoundSystem.h"
#include "Led\LedDriver.h"
#include "DealProtocol.h"

/*!\class EventReceiver
Class for event manager*/
class EventReceiver : public IEventReceiver
{
	GraphicEngine	*AEngine;
	DealProtocol	*ProtDealer;
	LedDriver		*myStimuli;
	float			Xscale;
public:
	EventReceiver(GraphicEngine *Engine,DealProtocol *pDealer, LedDriver * myLed);
	~EventReceiver(void);
	
	/*!\fn bool OnEvent(const SEvent &event)
	This function is used to manage the protocols.\n
	Here the keys event are shown:\n
	- P: Start Protocol;\n
	- O: Stop Protocol;\n
	- Z: Show the position of the LEDs;\n
	- A: Turn on all the LEDs for testing;\n
	- S: Turn off all the LEDs;\n
	- UP,DOWN,LEFT,RIGHT: Send classification in the relative direction;\n\n
	Socket events and generic events are managed directly in the protocols code.*/
	bool OnEvent(const SEvent &event);

};
